package cn.yunhe.services;

import org.apache.ibatis.session.SqlSession;

import cn.yunhe.dao.IUserDao;
import cn.yunhe.model.User;
import cn.yunhe.util.SqlSessionFactoryUtil;

/**
 * 
 * @author Administrator
 *
 */
public class UserServices {
	SqlSession se = SqlSessionFactoryUtil.getSqlSession();
	IUserDao userDao = se.getMapper(IUserDao.class);
	/**
	 * 用户登录
	 * @param name
	 * @param pass
	 * @return
	 */
	public User login(String name,String pass){
		return userDao.login(name, pass);
	}
	/**
	 * 用户注册
	 * @param user
	 * @return boolean
	 */
	public boolean regist(User user){
		boolean flag = userDao.regist(user);
		se.commit();
		return flag;
	}
}
